 
import ls from '@/lib/ls'

const hasRole = {
  mounted(el, binding) { 
    const userRoleALL = ls.get('USER_ROLE_ALL')
    const userRole = userRoleALL.map(item => item.name); // ['admin','user','editor']   
    if (!userRole.includes(binding.value)) {
      el.style.display = 'none';
    }
  }
};

export default hasRole; 